package com.example.demo.dao;

import com.example.demo.model.UserInfo;
import com.example.demo.model.UserInfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-09-16
 * Time: 16:52
 */
public interface UserMapper {
    @Insert("insert into userinfo(username,password) values(#{username},#{password})")
    int reg(UserInfo userInfo);

    @Select("select * from userinfo where username=#{username}")
    UserInfo getUserByName(@Param("username") String username);

    @Select("select * from userinfo where id=#{id}")
    UserInfoVO getUserById(@Param("id") int id);
}
